﻿@using  SpaceNeedle.City6473.Web.Data.Models

@{
    WebSiteContent staticContent = ViewBag.StaticContent as WebSiteContent;
    
    string siteTitle = staticContent.Title;
    string viewTitle = ViewBag.Title;
    string pageTitle = viewTitle + " | " + siteTitle;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@pageTitle</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/bootstrap")
    
    <script>
        function ShowLoading()
        {
            $("#loading").show();
        }

        function HideLoading()
        {
            $("#loading").hide();

        }
    </script>
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink(siteTitle, "Index", "Home", null, new { @class = "brand" })
                <div class="nav-collapse collapse">
                    <ul class="nav">
                        
                        @if(SpaceNeedle.City6473.WebSite.Security.Mvc.Auth.CurrentUser != null)
                        {
                            <li>@Html.ActionLink(staticContent.RequestItems.PageTitle, "RequestItems", "Admin")</li>
                            if(SpaceNeedle.City6473.WebSite.Security.Mvc.Auth.IsAdmin)
                            {
                                <li>@Html.ActionLink(staticContent.AppContent.PageTitle, "Index", "AppContent")</li>
                                <li>@Html.ActionLink(staticContent.Requests.PageTitle, "Requests", "Admin")</li>
                                <li>@Html.ActionLink(staticContent.Phones.PageTitle, "Phones", "Admin")</li>
                                <li>@Html.ActionLink(staticContent.Apps.PageTitle, "Index", "Apps")</li>
                                <li>@Html.ActionLink(staticContent.Alerts.PageTitle, "Alerts", "Admin")</li> 
                                <li>@Html.ActionLink(staticContent.Users.PageTitle, "Users", "Admin")</li>
                            }
                            <li>@Html.ActionLink(staticContent.Menu.SignOut, "SignOut", "Users")</li>
                        }
                        else
                        {
                            <li>@Html.ActionLink(staticContent.Menu.SignIn, "Login", "Users")</li>
                        }
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="container">
        <h2>@ViewBag.Title</h2>
        <br />
        @RenderBody()
        <hr />
        <footer>
            <p>@Html.Raw(staticContent.Copyright)</p>
        </footer>
    </div>

    <div id="loading" style="display:none; position:fixed; right:10px;top:50px;"><img src="/content/images/loading.gif"/></div>
   
    @RenderSection("scripts", required: false)
</body>
</html>